﻿using System;
using System.Collections.Generic;
using System.Text;
namespace SmugMugApiWrapper
{
    class SmugMugArguments
    {
    }
    public class DeleteImageArguments
    {
        /*
         * http://smugmug.jot.com/WikiHome/1.2.0/smugmug.images.delete
         * 
         * API Method: smugmug.images.delete

        This method deletes the specified Image.
        Arguments:

            * String SessionID
            * int ImageID


        Result:

            * String == "SUCCESS" 


        Fault Codes:

            * 3 - "invalid session"
            * 4 - "invalid user"
            * 5 - "system error"


         * 
         * 
         */

        private string _imageID = "";
        private string _imageKey = "";

        public string ImageId {
            get { return _imageID; }
            set { _imageID = value; }
        }
        public string ImageKey {
            get { return _imageKey; }
            set { _imageKey = value; }
        }

        public DeleteImageArguments(string imageId, string imageKey) {
            _imageID = imageId;
            _imageKey = imageKey;
        }

    }
    public class CreateAlbumArguments
    {

        /*
        
         *      http://smugmug.jot.com/WikiHome/API/Versions/1.1.1/1.1.1_smugmug.albums.create
         *      
         * 
         *      * String SessionID
                * String Title
                * int CategoryID
                * struct: [optional, any or none of these can be present]
                      o int "AlbumTemplateID"
                            + Use a pre-made album template? Overrides all other settings which templates can control.
                            + Default: 0
                      o int "SubCategoryID"
                            + Does this album belong to a SubCategory?
                            + Default: 0
                      o int "CommunityID"
                            + Is this album a part of a community?
                            + Default: 0
                      o String "Description"
                            + Text description of the contents of the album
                      o String "Keywords"
                            + Any keywords used to search or describe the album
                      o String "Password"
                            + Optional password to protect this album
                      o String "PasswordHint"
                            + optional, gives your visitors a hint
                      o int "Position"
                            + The album's position within it's Category/SubCategory, starting with 1 at the top
                            + Default: 1
                      o String "SortMethod"
                            + The method by which to sort the photos when displaying them.
                            + Default: "Position"
                            + Valid values:
                                  # "Position": Sorts by user-specified position.
                                  # "Caption": Sorts by the image captions
                                  # "FileName": Sorts by the filename of each photo
                                  # "Date": Sorts by the date uploaded to smugmug
                                  # "DateTime": Sorts by the date last modified, as told by EXIF data. Many files don't have this field correctly set.
                                  # "DateTimeOriginal": Sorts by the date taken, as told by EXIF data. Many cameras don't report this properly. 
                      o boolean "SortDirection"
                            + Which direction to order the SortMethod
                            + Default: 0 (Ascending)
                            + Valid values:
                                  # 0: Ascending (1-99, A-Z, 1980-2004, etc)
                                  # 1: Descending (99-1, Z-A, 2004-1980, etc)
                      o boolean "Public"
                            + is this album public?
                            + Default: 1
                      o boolean "Filenames"
                            + show filenames if no caption?
                            + Default: 0
                      o boolean "Comments"
                            + allow comments?
                            + Default: 1
                      o boolean "External"
                            + allow external linking?
                            + Default: 1
                      o boolean "EXIF"
                            + Display extended camera information?
                            + Default: 1
                      o boolean "Share"
                            + Enable 'easy sharing' button and features?
                            + Default: 1
                      o boolean "Printable"
                            + Allow prints to be purchased?
                            + Default: 1
                      o boolean "Originals"
                            + Allow Original photos to be seen?
                            + Default: 1
                      o boolean "FamilyEdit"
                            + Allow Family to edit captions & keywords?
                            + Default: 0
                      o boolean "FriendEdit"
                            + Allow Friends to edit captions & keywords?
                            + Default: 0
                      o boolean "Header"
                            + Display custom header, if any?
                            + POWER+PRO ONLY!
                            + Default: 0
                      o int "TemplateID"
                            + Force a display style?
                            + POWER+PRO ONLY!
                            + Possible values:
                                  # Viewer Choice (Recommended!): 0
                                  # SmugMug: 3
                                  # SmugMug Small: 10
                                  # Traditional: 4
                                  # All Thumbs: 7
                                  # Slideshow: 8
                                  # Journal: 9
                                  # Filmstrip: 11
                            + Default: 0
                      o boolean "Larges"
                            + Allow Large photos to be seen?
                            + PRO ONLY!
                            + Default: 1
                      o boolean "Clean"
                            + Display album in Clean style?
                            + PRO ONLY!
                            + Default: 0
                      o boolean "Protected"
                            + Enable heavy image protection?
                            + PRO ONLY!
                            + Default: 0
                      o boolean "Watermark"
                            + Enabled watermarking of photos?
                            + PRO ONLY!
                            + Default: 0
                      o int "ProofDays"
                            + delay printing for up to 7 business days? 
                            + PRO ONLY!
                            + Default: 0
                      o string "Backprinting"
                            + want something printed on the backs of prints?
                            + PRO ONLY!
                      o boolean "SmugSearchable"
                            + want your gallery searchable by other SmugMuggers?
                      o booealn "WorldSearchable"
                            + want your gallery searchable via search engines? 
        
        */


        private string _albumToCreate = String.Empty;
        private string _category = String.Empty;
        private string _subCategory = String.Empty;
        private string _description = String.Empty;
        private string _albumKey = String.Empty;
        private bool _public = true;
        private bool _protected = false;
        private bool _comments = false;

        public string AlbumKey
        {
            get { return _albumKey; }
            set { _albumKey = value; }
        }
        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }
        public bool AllowComments {
            get { return _comments; }
            set { _comments = value; }
        }
        public bool Public
        {
            get { return _public; }
            set { _public = value; }
        }
        public string Name
        {
            get { return _albumToCreate; }
            set { _albumToCreate = value; }
        }
        public string Category
        {
            get { return _category; }
            set { _category = value; }
        }
        public string SubCategory
        {
            get { return _subCategory; }
            set { _subCategory = value; }
        }
        public bool Protected
        {
            get { return _protected; }
            set { _protected = value; }
        }
    }
    public class CreateCategoriesArguments
    {
        private string _categoryToCreate = "";

        public CreateCategoriesArguments(string categoryToCreate)
        {
            _categoryToCreate = categoryToCreate;
        }
        public string Name
        {
            get { return _categoryToCreate; }
            set { _categoryToCreate = value; }
        }
    }
    public class PostPicturesToSmugMugArguments
    {


        //headers info comes from http://smugmug.jot.com/WikiHome/API/Uploading
        /*  Headers required or supported:

        # Content-Length
            * required
            * standard HTTP header, must match the actual bytes sent in the body (your image)
        # Content-MD5
            * required
            * standard HTTP header, must be an MD5 of the data in the body (your image)
        # X-Smug-SessionID
            * required
            * SessionID from API login calls
        # X-Smug-Version
            * required
            * API Version (ex: 1.1.1)
        # X-Smug-ResponseType
            * required
            * set "XML-RPC", "REST", "JSON" or "PHP" depending on your desired response formatting.
        # X-Smug-AlbumID
            * required (for uploading new photos, not for replacing existing photos)
            * The AlbumID you're adding the photo to
        # X-Smug-ImageID
            * required (for replacing existing photos, not for uploading new photos)
            * The ImageID of the photo you are replacing
        # X-Smug-FileName
            * optional
            * The filename of the photo you're adding
        # X-Smug-Caption
            * optional
            * Sets the Caption on the image
            * For multi-line captions, use a carriage return between lines
        # X-Smug-Keywords
            * optional
            * Sets the Keywords on the image
        # X-Smug-Latitude
            * optional
            * Sets the Latitude of the image (in the form D.d, such as 37.430096)
        # X-Smug-Longitude
            * optional
            * Sets the Longitude of the image (in the form D.d, such as -122.152269)
        # X-Smug-Altitude
            * optional
            * Sets the Altitude of the image (in meters)

        */

        private string _smugmugAlbumName = "";
        private string _smugmugFileName = "";
        private string _smugmugCaption = "";
        private string _smugmugKeywords = "";
        private readonly string _smugmugVersion = "1.2.0";
        private readonly string _smugmugResponseType = "REST";
        private string _smugmugImageId = "";
        private string _smugmugImageKey = "";
        private string _smugmugLatitude = "";
        private string _smugmugLongitude = "";
        private string _smugmugAltitude = "";
        private bool _deleteAfterUpload = false;

        public bool DeleteAfterUpload
        {
            get { return _deleteAfterUpload; }
            set { _deleteAfterUpload = value; }
        }

        public string ImageKey
        {
            get { return _smugmugImageKey; }
            set { _smugmugImageKey = value; }

        }
        public string ImageId
        {
            get { return _smugmugImageId; }
            set { _smugmugImageId = value; }
        }

        public string Version
        {
            get { return _smugmugVersion; }
        }

        public string ResponseType
        {
            get { return _smugmugResponseType; }
        }


        public string Latitude
        {
            get { return _smugmugLatitude; }
            set { _smugmugLatitude = value; }
        }

        public string Longitude
        {
            get { return _smugmugLongitude; }
            set { _smugmugLongitude = value; }
        }

        public string Altitude
        {
            get { return _smugmugAltitude; }
            set { _smugmugAltitude = value; }
        }


        public string AlbumName
        {
            get { return _smugmugAlbumName; }
            set { _smugmugAlbumName = value; }
        }

        public string FileName
        {
            get { return _smugmugFileName; }
            set { _smugmugFileName = value; }
        }

        public string Caption
        {
            get { return _smugmugCaption; }
            set { _smugmugCaption = value; }
        }

        public string Keywords
        {
            get { return _smugmugKeywords; }
            set { _smugmugKeywords = value; }
        }



    }
    public class DownloadImagesArguments
    {
        private string _albumName = "";
        private string _downloadLocation = "";

        public string AlbumName
        {
            get { return _albumName; }
            set { _albumName = value; }
        }
        public string DownloadLocation
        {
            get { return _downloadLocation; }
            set { _downloadLocation = value; }
        }
    }
    public class GetEXIFArguments
    {

        private int _imageID;
        private string _password;
        private string _imageKey;

        public string ImageKey
        {
            get { return _imageKey; }
            set { _imageKey = value; }
        }

        public int ImageID
        {
            get { return _imageID; }
            set { _imageID = value; }
        }
        public string Password
        {
            get { return _password; }
            set { _password = value; }
        }
        public GetEXIFArguments(int imageID, string imageKey)
        {
            _imageID = imageID;
            _imageKey = imageKey;
        }
        public GetEXIFArguments(int imageID, string imageKey, string password)
        {
            _imageID = imageID;
            _imageKey = imageKey;
            _password = password;
        }
    }
    public class GetImagesInfoArguments
    {
        private string _albumName = "";

        public string AlbumName
        {
            get { return _albumName; }
            set { _albumName = value; }
        }
    }
    public class GetImagesArguments
    {

        private string _albumName = "";

        public string AlbumName
        {
            get { return _albumName; }
            set { _albumName = value; }
        }
    }
    public class SetImageInfoArguments
    {

        private int _imageID;
        private string _imageKey = string.Empty;

        private string _albumName = String.Empty;
        private string _caption = String.Empty;
        private string _keywords = String.Empty;
        private bool _hidden = false;

        public string AlbumName
        {
            get { return _albumName; }
            set { _albumName = value; }
        }
        public string Caption
        {
            get { return _caption; }
            set { _caption = value; }
        }
        public string Keywords
        {
            get { return _keywords; }
            set { _keywords = value; }
        }
        public bool Hidden
        {
            get { return _hidden; }
            set { _hidden = value; }
        }
        public int ImageID { get { return _imageID; } }
        public string ImageKey { get { return _imageKey; } }

        public SetImageInfoArguments(int imageID, string imageKey)
        {
            _imageID = imageID;
            _imageKey = imageKey;
        }

    }
    public class GetImageInfoArguments
    {
        private int _imageID;
        private string _imageKey;
        public int ImageID { get { return _imageID; } }
        public string ImageKey { get { return _imageKey; } }
        public GetImageInfoArguments(int imageID, string imageKey)
        {
            _imageID = imageID;
            _imageKey = imageKey;
        }

    }
    public class ChangeSettingsArguments {
        private int _imageID;
        private string _imageKeywords;
        private string _imageCaption;
        private bool _imageHidden;
        

        public ChangeSettingsArguments(int imageID, string caption, string keywords, bool hidden) {

            _imageID = imageID;

            if (!string.IsNullOrEmpty(caption))
                _imageCaption = caption;

            if (!string.IsNullOrEmpty(keywords))
                _imageKeywords = keywords;

            _imageHidden = hidden;
        
        }

        public string Caption {
            get { return _imageCaption; }
        }
        public int ImageID { get { return _imageID; } }
        public string ImageKeywords { get { return _imageKeywords; } }
        public bool Hidden { get { return _imageHidden; } }

    
    }

}
